import React from 'react';
import {getAgentsId} from '../../../settings'
import { connect } from 'dva';
import { NoticeBar } from 'antd-mobile';
import styles from './bulletin_board.less';
import { Icon } from 'antd-mobile';
@connect(({ bulletin }) => ({
    bulletin
}))
export default class BulletinBoard extends React.Component {


 render() {
    //console.log(this.props.bulletin)
    let msg = "";
    if(this.props.bulletin&&this.props.bulletin.bulletin){
        let bulletins = this.props.bulletin.bulletin
        if(bulletins.length > 0){
            msg = bulletins[0].announcementContent
        }
    }
    return (
           <div className={styles.board_all}>

               <div className={styles.board_222}>
                   <img src="./img/announcement.png" className={styles.board_text} alt=""/>
                   <NoticeBar icon={null} className={styles.board_in} marqueeProps={{ loop: true, style: { color:'#333'} }}>
                       {msg}
                   </NoticeBar>
               </div>
               {/* <img src="./img/in.png" className={styles.board_icon} alt=""/> */}

            </div>
     )
 }

 componentDidMount(){
    const { dispatch } = this.props

        dispatch({
            type: 'bulletin/selbulletin',
            payload: {agentsId:getAgentsId()},
        })
  }


}
